package gui.swing;

import javax.swing.*;
import java.awt.*;

public class JPanelDemo extends JFrame {

    public JPanelDemo(){
        Container contentPane = getContentPane();
        contentPane.setLayout(new GridLayout(2,1,10,10));

        JPanel jP1 = new JPanel(new GridLayout(1,3));

        jP1.add(new JButton("1"));
        jP1.add(new JButton("2"));
        jP1.add(new JButton("3"));

        contentPane.add(jP1);

        setBounds(100,100,500,500);
        setVisible(true);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new JPanelDemo();
    }
}
